﻿using System.ComponentModel.DataAnnotations;

namespace TimeProject.WebSite.ViewModels
{
    public partial class RegisterViewModel : ViewModelBase
    {
        /// <summary>
        /// The username.
        /// </summary>
        [Required(ErrorMessage = "The username is required.")]
        [Display(Name = "Username")]
        [StringLength(256, ErrorMessage = "The username must be at least {2} characters long.", MinimumLength = 6)]
        public string Username { get; set; }

        /// <summary>
        /// The password.
        /// </summary>
        [Required(ErrorMessage = "The password is required.")]
        [StringLength(100, ErrorMessage = "The password must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm password")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }

        /// <summary>
        /// The user's full name.
        /// </summary>
        [MaxLength(256)]
        [Required(ErrorMessage = "The full name is required.")]
        [Display(Name = "Full name")]
        public string FullName { get; set; }

        /// <summary>
        /// The user's e-mail address.
        /// </summary>
        [MaxLength(256)]
        [Display(Name = "E-mail")]
        public string EMail { get; set; }

        [MaxLength(256)]
        [Display(Name = "Confirm e-mail")]
        [Compare("EMail", ErrorMessage = "The e-mail and confirmation e-mail do not match.")]
        public string ConfirmEMail { get; set; }

        /// <summary>
        /// Accept the licence agreement.
        /// </summary>
        [Display(Name = "Accept licence agreement")]
        public bool AcceptLicence { get; set; }
    }
}
